package demo.sniff4jUiMode;
import java.awt.EventQueue;

import demo.http.base.HttpRuntime;
import demo.http.ui.MainUi;
import net.jueb.sniff4j.extr.base.DefaultRunTime;
import net.jueb.sniff4j.socksCroe.SocksServer;

public class TestByUiMode {
	
	public static void main(String[] args) {
		new TestByUiMode().UiMode();
	}
	public void ConsolMode(String[] args)
	{
		if(args.length==1 && args[0].toLowerCase().equals("ui"))
		{
			EventQueue.invokeLater(new Runnable() {
		        @Override
		        public void run() {
		        	MainUi frame = new MainUi();
		        	DefaultRunTime runTime=new DefaultRunTime();
					frame.setRunTime(runTime);
					frame.setVisible(true);
		        }
		    });
		}else
		{//命令行模式
			HttpRuntime rt=new HttpRuntime();
			new SocksServer().run(rt);
		}
	}
	public void UiMode()
	{
		EventQueue.invokeLater(new Runnable() {
	        @Override
	        public void run() {
	        	MainUi frame = new MainUi();
				DefaultRunTime runTime=new DefaultRunTime();
				frame.setRunTime(runTime);
				frame.setVisible(true);
	        }
	    });
	}
}
